/////////
// Author: Nick Viselli
// Date: 3/16/2013
// Class: SGP1
// Last Modified: 3/16/2013 2:56 PM
// Purpose: Will handle all basic information for all classes
////////
#pragma once
#include "IEntity.h"
class CEntity : public IEntity
{
public:
	CEntity(void);
	virtual ~CEntity(void);
	virtual void Update(float fElapsedTime);
	virtual void Render( void );
	virtual bool CheckCollision( IEntity* pOther);
	void AddRef(); // A reference has been added to another thing
	void Release(); // A reference has been removed
	RECT GetRect();
	int	 GetType() { return m_eType;}

	float GetPosX() { return m_fPosX;}
	float GetPosY() { return m_fPosY;}
	float GetPrevPosX() { return m_fPrevPosX;}
	float GetPrevPosY() { return m_fPrevPosY;}
	float GetVelX() { return m_fVelX;}
	float GetVelY() { return m_fVelY;}
	int GetWidth() { return m_nWidth;}
	int GetHeight() { return m_nHeight;}

	void SetPosX(float fX) {m_fPosX = fX;}
	void SetPosY(float fY) {m_fPosY = fY;}
	void SetPrevPosX(float fX) {m_fPrevPosX = fX;}
	void SetPrevPosY(float fY) {m_fPrevPosY = fY;}
	void SetVelX(float fX) { m_fVelX = fX;}
	void SetVelY(float fY) { m_fVelY = fY;}
	void SetWidth(int nW) { m_nWidth = nW;}
	void SetHeight(int nH) { m_nHeight = nH;}

	virtual void HandleEvent(CEvent* pEvent);

protected:
	enum Type { ENTITY_ENTITY, ENTITY_PLAYER, ENTITY_ENEMY, ENTITY_KEY,
		ENTITY_GUN, ENTITY_POWERUP, ENTITY_BULLET};
	Type m_eType;	 // What am I 0-6
private:
	float m_fPosX;	 //	Position x
	float m_fPosY;	 //	Position y
	float m_fPrevPosX; //	Previous Position x
	float m_fPrevPosY; //	Previous Position y
	float m_fVelX;	 //	Velocity x
	float m_fVelY;	 //	Velocity y
	int m_nWidth;	 //	Width
	int m_nHeight;	 //	Height
	int m_nImage;	 //	What image is mine
	unsigned int m_unReferences; // How many things hold a reference to me

};

